package com.hui.config;//package hui.config;
//
//import cn.hutool.crypto.symmetric.DES;
//import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
//import cn.hutool.crypto.symmetric.SymmetricCrypto;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.stereotype.Component;
//
//@Component
//public class CustomPasswordEncoder implements PasswordEncoder {
//
//    @Value("${des.key}")
//    private String aesKey;
//
//    @Override
//    public String encode(CharSequence charSequence) {
//        //随机生成密钥
//        SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.DESede, aesKey.getBytes());
//        return aes.encryptHex(charSequence.toString());
//    }
//
//    @Override
//    public boolean matches(CharSequence charSequence, String s) {
//        return s.equals(this.encode(charSequence));
//    }
//}
